<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
</head>

<body>
    <div class="container">
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">阿柯云音乐</a>
                </div>
                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#/find">发现音乐 <span class="sr-only">(current)</span></a></li>
                        <li><a href="#/my">我的音乐</a></li>
                        <li><a href="#/firend">朋友圈音乐</a></li>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </div>
            <!-- /.container-fluid -->
        </nav>
    </div>
    <div id="content" class="container"></div>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script>
hashchangeHandler()

window.onhashchange = hashchangeHandler

function hashchangeHandler(){
	var hash = window.location.hash
	$("[href='"+hash+"']").parent().addClass('active').siblings('li').removeClass('active')
	hash = hash.substring(1)
	$.ajax({
		url:'./'+hash+'.html'
	}).then(res=>$('#content').html(res),err=>console.log(err.message))
}
</script>
</body>

</html>